package cn.wolfcode.crm.web.controller;

import cn.wolfcode.crm.domain.ProductStock;
import cn.wolfcode.crm.query.JSONResult;
import cn.wolfcode.crm.query.PageResult;
import cn.wolfcode.crm.query.QueryObject;
import cn.wolfcode.crm.service.IDepotService;
import cn.wolfcode.crm.service.IProductStockService;
import cn.wolfcode.crm.service.ISupplierService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;


@Controller
@RequestMapping("productStock")
public class ProductStockController {

    @Autowired
    private IProductStockService productStockService;
    @Autowired
    private ISupplierService supplierService;
    @Autowired
    private IDepotService depotService;

    //由于dataGrid组件返回必须为json,所以跳转界面就分开
    @RequestMapping("view")
    public String view(){
        return "productStock";
    }

    //页面数据
    @RequestMapping("query")
    @ResponseBody
    public PageResult query(QueryObject qo){
        return productStockService.query(qo);
    }
    //页面数据
    @RequestMapping("getLow")
    @ResponseBody
    public Integer getLow(){
        return productStockService.getLow();
    }

}
